﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace _013_线程_通过Thread发起
{
    class Program
    {
        static void DownloadFile(object name)
        {
            Console.WriteLine("开始下载:"+name as string);
            Thread.Sleep(2000);
            Console.WriteLine("下载完成");
        }
        static void Main(string[] args)
        {
            // 实例化Thread对象
//            Thread t = new Thread(DownloadFile);
            
            //启动
//            t.Start("战神.txt");

            MyThread my = new MyThread("战神.txt","https://www.xxx.com");
            Thread t = new Thread(my.DownLoad);
            t.Start();
            Console.ReadKey();

        }
    }
}
